// 先变成promise    async await
// get请求
function getTest(that, url) {

    return new Promise((resolve, reject) => {
        that.$http
            .get(url)
            .then(res => {
                console.log(res);
                resolve(res)
            })
            .catch(err => {
                console.log(err);
                reject(err);
            });
    })
}
// post
function postTest(that, url, data) {
    console.log(url);
    return new Promise((resolve, reject) => {
        that.$http.post(url, data).then(res => {
                console.log(res);
                resolve(res)
            })
            .catch(err => {
                console.log(err);
                reject(err);
            });
    })
}
export {
    getTest,
    postTest
}